import { WidgetType } from '@codemirror/view';
export class CheckboxWidget extends WidgetType {
    constructor() {
        super();
    }
    eq(other) { return other.checked === this.checked }

    toDOM() {
        let wrap = document.createElement("span")
        wrap.setAttribute("aria-hidden", "true")
        wrap.className = "cm-boolean-toggle"
        let box = wrap.appendChild(document.createElement("input"))
        box.type = "checkbox"
        box.checked = this.checked
        return wrap
    }

    ignoreEvent() { return false }
}